// vite.config.ts
import { defineConfig, loadEnv } from "file:///D:/desktop/ISRMS/lib-carale/node_modules/.pnpm/vite@5.2.7_sass@1.72.0/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/desktop/ISRMS/lib-carale/node_modules/.pnpm/@vitejs+plugin-vue@5.0.4_vite@5.2.7_vue@3.4.21/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import path from "path";
import { createSvgIconsPlugin } from "file:///D:/desktop/ISRMS/lib-carale/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@5.2.7/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import { viteMockServe } from "file:///D:/desktop/ISRMS/lib-carale/node_modules/.pnpm/vite-plugin-mock@3.0.1_esbuild@0.20.2_mockjs@1.1.0_vite@5.2.7/node_modules/vite-plugin-mock/dist/index.mjs";
var vite_config_default = defineConfig((command, mode) => {
  let env = loadEnv(mode, process.cwd());
  return {
    plugins: [
      vue(),
      // SVG图标配置
      createSvgIconsPlugin({
        // Specify the icon folder to be cached
        iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
        // Specify symbolId format
        symbolId: "icon-[dir]-[name]"
      }),
      //mock
      viteMockServe({
        //@ts-ignore
        localEnabled: command === "serve"
        //开发阶段可以使用mock接口
      })
    ],
    //src别名的配置
    resolve: {
      alias: {
        "@": path.resolve("./src")
        // 相对路径别名配置，使用 @ 代替 src
      }
    },
    //scss全局变量
    css: {
      preprocessorOptions: {
        scss: {
          javascriptEnabled: true,
          additionalData: '@import "./src/styles/variable.scss";'
        }
      }
    },
    //代理跨域
    server: {
      host: "0.0.0.0",
      port: 4e3,
      //设置服务启动端口
      // open:true,    //设置服务启动时是否自动打开浏览器
      cors: true,
      //允许跨域
      proxy: {
        [env.VITE_APP_BASE_API]: {
          //获取数据的服务器地址设置
          target: env.VITE_SERVE,
          //需要代理跨域
          changeOrigin: true,
          //路径重写
          //rewrite: (path: string) => path.replace(/^\/api/, ""),
          rewrite: (path2) => path2.replace(
            new RegExp("^" + env.VITE_APP_BASE_API),
            // ^/dev-api
            env.VITE_APP_TARGET_BASE_API
            // ""
          )
          // 以 /dev-api 开头的请求转发至 target，示例： http://localhost:3000/dev-api/v1/users (F12可见) 代理转发 https://api.xxx.com/v1/users (真实接口地址)
        }
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFxkZXNrdG9wXFxcXElTUk1TXFxcXGxpYi1jYXJhbGVcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkQ6XFxcXGRlc2t0b3BcXFxcSVNSTVNcXFxcbGliLWNhcmFsZVxcXFx2aXRlLmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRDovZGVza3RvcC9JU1JNUy9saWItY2FyYWxlL3ZpdGUuY29uZmlnLnRzXCI7aW1wb3J0IHsgZGVmaW5lQ29uZmlnLCBsb2FkRW52IH0gZnJvbSBcInZpdGVcIjtcbmltcG9ydCB2dWUgZnJvbSBcIkB2aXRlanMvcGx1Z2luLXZ1ZVwiO1xuLy9AXG5pbXBvcnQgcGF0aCBmcm9tIFwicGF0aFwiO1xuLy9zdmdcbmltcG9ydCB7IGNyZWF0ZVN2Z0ljb25zUGx1Z2luIH0gZnJvbSBcInZpdGUtcGx1Z2luLXN2Zy1pY29uc1wiO1xuLy9tb2NrXG5pbXBvcnQgeyB2aXRlTW9ja1NlcnZlIH0gZnJvbSBcInZpdGUtcGx1Z2luLW1vY2tcIjtcblxuLy9AdHMtaWdub3JlXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25ma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